﻿using ReflectionStudio.Core.Events;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Globalization;
using System.IO;
using System.IO.Packaging;
using System.Linq;
using System.Printing;
using System.Windows;
using System.Windows.Documents;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Xps;
using System.Windows.Xps.Packaging;
using System.Xml;
using WPFExcelReport.Helpers;
using System.Printing;
namespace WPFExcelReport
{

    public partial class TPCLTOOLS
    {
        public TPCLTOOLS()
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;
            MV = new VICC_PRNDEF();
            this.DataContext = MV;
            InitializeComponent();
        }

        public override void Window_Loaded(object sender, RoutedEventArgs e)
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;
            if (IsLoaded)
                return;
            ART = Helper.ApplicationPath.Replace("\\Exe", "\\Documents\\Print\\CHLOE.027"); 
            ART = @"D:\ITXRPRT\Documents\Print\15HU.173";
            Helper.CheckDirectory(Helper.ApplicationPath.Replace("\\Exe", ""), "Documents");
            base.Window_Loaded(sender, e);
        }
        public override void PreviewCommand(object sender, RoutedEventArgs e)
        {
            Helper.PCL2EXCEL(ART);
            Papers = new Dictionary<string, StdPapers>();
            Papers.Add("LETTER", new StdPapers(2550, 3300));
            Papers.Add("LEGAL", new StdPapers(2550, 4200));
            Papers.Add("LEDGER", new StdPapers(3300, 5100));
            Papers.Add("EXECUTIVE", new StdPapers(2175, 3150));
            Papers.Add("A4", new StdPapers(2480, 3507));
            Papers.Add("A3", new StdPapers(3507, 4960));
            Papers.Add("COM-10", new StdPapers(1237, 2850));
            Papers.Add("Monarch", new StdPapers(1162, 2250));
            Papers.Add("C5", new StdPapers(1913, 2704));
            Papers.Add("B5", new StdPapers(2078, 2952));
            Papers.Add("DL", new StdPapers(1299, 2598));
            ID = 0;
            PCLParse(ART);
            PreViewBMP(TBMain);
            /*
            Convert2XPS(TBMain);
            XpsDocument doc = new XpsDocument(@"D:\ITXRPRT\Documents\Print\XpsDocument.xps", System.IO.FileAccess.Read);
            documentViewer1.Document = doc.GetFixedDocumentSequence();
            WaitPanel.Stop();*/
            base.PreviewCommand(sender, e);
        }
    } 
   
}
